<template>
	<view>
	<view class="uni-list">
			<view class="uni-list-cell" hover-class="uni-list-cell-hover" @click="goTo(0)">
				<view class="uni-list-cell-navigate uni-navigate-right uni-media-list ">

					<view class="uni-media-list-logo" >更换账号</view>
					<view class="uni-media-list-body" >
						{{userInfo.userLoginId}}
					</view>
				</view>
			</view>
			<view class="uni-list-cell" hover-class="uni-list-cell-hover" @click="goTo(1)">
							<view class="uni-list-cell-navigate uni-navigate-right uni-media-list ">
			
								<view class="uni-media-list-logo" >密码</view>
								<view class="uni-media-list-body" >
									更换
								</view>
							</view>
						</view>
		</view>
		
	</view>
</template>

<script>
	import {
		mapGetters,mapState 
	} from 'vuex'
	
	export default {
		data() {
			return {
				pages: [
					"/pages/security/changelogin",
					"/pages/security/pwd"
				],
			};
		},
		onLoad(e) {
			if(e.delta !== undefined)
				this.delta = this.delta+ e.delta
		},
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo
			}),
			...mapGetters(
				["hasLogin"],
			),
		},
		methods: {
			goTo: function(index) {
				var that = this;
				uni.navigateTo({
					url: that.pages[index]+"?userLoginId="+ that.userInfo.userLoginId
				})
			}
		}
	}
</script>

<style>
	.uni-media-list-logo {
		width: 200upx;
	}
</style>
